package main


import (
	"fmt"
)

type Stu struct{
	name string 
	gender string 
	age int 
	id int 
	score float64
}
func (stu *Stu)say()(string){

	info:=fmt.Sprintf("name=%v,gender=%v,age=%v,id=%v,score=%v\n",stu.name,stu.gender,stu.age,stu.id,stu.score)
	return info
}

type vistor struct{
	Name string 
	Age int 
}
func (v *vistor)show(){

	if v.Age >=90 || v.Age<=8{
		fmt.Println("you age not secure")
		return 
	}

	if v.Age<=18{
		fmt.Println("cost 20 yuan")
	}else if v.Age>18{
		fmt.Println("cost 200 yuan")
	}

}
func main(){


	stu1:=Stu{
		name:"jack",
		gender:"feamle",
		age:1000,
		id:100,
		score:100.22,
	}

	fmt.Println(stu1.say())

	var v vistor
	for {

		fmt.Println("input your Name")
		fmt.Scanln(&v.Name)
		
		if v.Name == "n"{
			fmt.Println("exit")
			break
		}
		fmt.Println("input your age")
		fmt.Scanln(&v.Age)

		v.show()
	}
}